package com.itHsuSE.object;

public class Finalize {
    public static void main(String[] args) {
/*
        Car car=new Car("bmw");
        System.out.println(car.getName());
        car=null;
        car=new Car("benz");
        System.out.println(car.getName());
*/
        int sum=0;
        for (int i = 0; i < 5; i++) {
            sum+=i;
            System.out.println("i="+i);
            System.out.println("sum="+sum);
        }
        System.out.println("结束");
    }
}

class Car{
    private String name;

    public Car(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
